<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script type="text/javascript">

function checkForBlanck(){
	
	if(document.getElementById('fname').value=""){
		alert('Please ...enter your First Name');
		document.getElementById('fname').style.borderColor="red";
		return false;
	}
	
}

</script>
</head>

<body>
<form action="#" method="post" onsubmit="return checkForBlanck()">
<fieldset>
<label>FistName :<input type="text" name="fname" id="fname"/></label><br>
<label>LastName:<input type="text" name="lname" id="lname"/></label><br>
<input type="submit" value="Submit" onclick="return checkForBlanck()">
</fieldset>
</form>

</body>
</html>